import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/components/index'
import GoodsList from '@/components/goodsList'
import GoodsDetail from '@/components/goodsDetail'
import Login from '@/components/login'
import Cart from '@/components/cart'
import OrderConfirm from '@/components/orderConfirm'

Vue.use(Router)

export default new Router({
  //路由的跳转路径
  routes: [
    {
      path: '/',//首页
      name: 'Index',
      component: Index
    },
    {
      path: '/goodsList/:cid',//商品展示页面--cid:品类id
      name: 'GoodsList',
      component: GoodsList
    },
    {
      path: '/goodsDetail/:gid',//商品详情页面--gid:商品id
      name: 'GoodsDetail',
      component: GoodsDetail
    },
    {
      path: '/login',//登录页面
      name: 'Login',
      component: Login
    },
    {
      path: '/cart',//购物车页面
      component: Cart
    },
    {
      path: '/orderConfirm',//购物车页面
      name: 'OrderConfirm',
      component: OrderConfirm
    }
  ],
  //指定路由的工作模式。
  mode:"history"//history：路径中不带“#”号
})
